		
/* ************************************************************************************* 
 * CREATED BY:          MYGENERATION
 * CREATED DATE:        4/20/2009
 * PROJECT:             MCWEBSITE
 * PURPOSE:             websiteVisitorBUL class
 * MODIFIED BY:         None
 * MODIFIED DATE:       None
 * MODIFIED REASON:     None
 * NOTES:               None
 **************************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using MCWEBSITE.DAL;
using MCWEBSITE.ENTITY;

namespace MCWEBSITE.BUL
{
    public class websiteVisitorBUL
    {
        public static int Save(websiteVisitorInfo _websiteVisitorInfo)
        {
            try
            {
                if (_websiteVisitorInfo.ID == 0)
                {
                    return websiteVisitorDAL.Insert(_websiteVisitorInfo);
                }
                else
                {
                    return websiteVisitorDAL.Update(_websiteVisitorInfo);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on insert theme : {0}", ex.Message));
            }
        }

        public static int Remove(int _ID)
        {
            try
            {
                return websiteVisitorDAL.Delete(_ID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static int UpdateCount()
        {
            try
            {
                return websiteVisitorDAL.UpdateCount();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error on delete Theme : {0}", ex.Message));
            }
        }

        public static List<websiteVisitorInfo> GetAll()
        {
            try
            {
                return websiteVisitorDAL.SelectAll();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static websiteVisitorInfo Load(int _ID)
        {
            try
            {
                return websiteVisitorDAL.SelectOne(_ID);
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }

        public static List<websiteVisitorInfo> Search()
        {
            try
            {
                return websiteVisitorDAL.SelectFilters();
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format("Error:{0}", ex.Message));
            }
        }
    }
}

		